#include <stdio.h>
#include"linkstack.h"

int main(int argc, char *argv[])
{
	// argv[1]每一个字符入栈
	if (argc < 2)
		return 1;
	stack_t *mystack = NULL;
	char i;

	stack_init(&mystack, sizeof(char));

	i = 0;
	while (argv[1][i]) {
		if (-1 == stack_push(mystack, argv[1] + i)) {
			printf("栈满了\n");
			break;
		}
		i++;
	}

	while (!stack_empty(mystack)) {
		stack_pop(mystack, &i);
		putchar(i);
	}
	putchar('\n');

	stack_destroy(&mystack);

	return 0;
}



